package com.wgc.search.listener;


import com.wgc.search.config.RabbitConfig;
import com.wgc.search.service.ESManagerService;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class GoodsListener {
    @Autowired
    private ESManagerService esManagerService;
    @RabbitListener(queues = RabbitConfig.GOODS_QUEUE)
    public void goodsListener(String message) {
        esManagerService.importById(message);
    }

}

